﻿/********************************************************************
	created:	2011-8-10   11:24
	author:		Lifan Su
	
	purpose:	implement of <cstdint> for MSVC
*********************************************************************/

#ifndef CSTDINT_MSVC_H
#define CSTDINT_MSVC_H

#if !defined _CSTDINT_HPP
#error "Don't include this file standalone, include cstdint.hpp"
#endif

#if !defined _MSC_VER
#error "Unsupported platform, did you just included this header?"
#endif

#if _MSC_VER == 1600
    #include <cstdint>
    #undef INTPTR_MAX
    #undef INTPTR_MIN
    #undef UINTPTR_MAX
    
    #if defined _M_X64 || defined _M_AMD64
        #define INTPTR_MIN          (-0x7fffffffffffffffi64 - 1)
        #define INTPTR_MAX          0x7fffffffffffffffi64
        #define UINTPTR_MAX         0xffffffffffffffffui64
    #elif defined _M_IX86
        #define INTPTR_MIN          (-0x7fffffffi32 - 1)
        #define INTPTR_MAX          0x7fffffffi32
        #define UINTPTR_MAX         0xffffffffui32
    #else
        #error "Unsupported Platform"
    #endif
#else
    #include "_stdint_msvc.h"
#endif

#endif // CSTDINT_MSVC_H